import 'package:flutter/material.dart';

class Chapter5Page extends StatelessWidget {
  const Chapter5Page({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("第五章"),
        leading: IconButton(
          icon: const Icon(Icons.home),
          onPressed: () => Navigator.of(context).pushNamed("/"),
        ),
      ),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            children: <Widget>[
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/padding"),
                child: const Text("填充（Padding）"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/decorated/box"),
                child: const Text("装饰容器DecoratedBox"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/transform"),
                child: const Text("变换（Transform）"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/container"),
                child: const Text("容器 Container"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/clip"),
                child: const Text("剪裁（Clip）"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/fitted/box"),
                child: const Text("空间适配 FittedBox"),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () =>
                    Navigator.of(context).pushNamed("/chapter5/scaffold"),
                child: const Text("Scaffold"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
